{% extends "app/base.html" %}
{% block title %}
    添加图书
{% endblock %}

{% block content-header %}
    添加图书
    <div style="float: right;">
        <a class="btn btn-default btn-xs" href="/">
            <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> 返回
        </a>
    </div>
{% endblock content-header %}
{% block content-body %}

    <form class="form-horizontal" action="/app/book/add/" method="post">
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">书名</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="name" placeholder="书名">
            </div>
        </div>
        <div class="form-group">
            <label for="pubDate" class="col-sm-2 control-label">出版日期</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="pubDate" placeholder="XXXX-XX-XX">
            </div>
        </div>
        <div class="form-group">
            <label for="price" class="col-sm-2 control-label">价格</label>
            <div class="col-sm-5">
                <input type="number" class="form-control" name="price" placeholder="价格">
            </div>
        </div>
        <div class="form-group">
            <label for="publish" class="col-sm-2 control-label">出版社</label>
            <div class="col-sm-5">
                <select class="form-control" name="publish_id">
                    {% for publish in publishs %}
                        <option value="{{ publish.nid }}">{{ forloop.counter }} {{ publish.name }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="publish" class="col-sm-2 control-label">作者</label>
            <div class="col-sm-5">
                {% for author in authors %}
                    <label class="checkbox-inline">
                        <input type="checkbox" id="inlineCheckbox1" name="author_ids" value="{{ author.nid }}"> {{ forloop.counter }}
                        {{ author.name }}
                    </label>

                {% endfor %}

            </div>
        </div>






        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>
{% endblock content-body%}